package com.yj.lottery_system.service.dto;

import com.yj.lottery_system.service.enums.*;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class ActivityDetailDTO {
    /**
     *活动信息
     */
    //活动id
    private Long activityId;

    //活动名
    private String activityName;

    //活动描述
    private String desc;

    //活动状态
    private ActivityStatusEnum status;

    /**
     * 判断状态是否有效
     * @return
     */
    public Boolean valid() {
        return status.equals(ActivityStatusEnum.RUNNING);
    }

    //奖品信息列表
    private  List<PrizeDTO> prizeDTOList;

    //人员信息列表
    private  List<UserDTO> userDTOList;

    @Data
    public static class PrizeDTO {
        //奖品id
        private Long PrizeId;
        //奖品描述
        private String description;

        //图片索引
        private String imageUrl;

        //奖品名
        private String name;

        //价格
        private BigDecimal price;

        //等级
        private ActivityPrizeTiresEnum tires;

        //数量
        private Long prizeAmount;

        //状态
        private ActivityPrizeStatusEnum status;
        /**
         * 判断状态是否有效
         * @return
         */
        public Boolean valid() {
            return status.equals(ActivityPrizeStatusEnum.INIT);
        }
    }
    @Data
    public static class UserDTO {

        //用户id
        private Long userId;

        //用户名
        private String userName;

        //状态
        private ActivityUserStatusEnum status;
        /**
         * 判断状态是否有效
         * @return
         */
        public Boolean valid() {
            return status.equals(ActivityUserStatusEnum.INIT);
        }
    }
}
